<template>
  <div class="cookbookIntegrate" v-if="search.list.length > 0">
    <CookbookSearchItem
      v-for="item in search.list"
      :key="item.r.id"
      :item="item"
    />
  </div>
</template>

<script setup lang="ts">
import CookbookSearchItem from "@/components/CookbookSearchItem.vue";
import { storeToRefs } from "pinia";
import { useDouguoStore } from "@/stores/douguo";
import { ref } from "vue";
import { useRouter } from "vue-router";

const douguo = useDouguoStore();

const { search } = storeToRefs(douguo);
const { updataSearch } = douguo;

const route: object = useRouter();

const obj1: object = ref({
  keyword: route.currentRoute.value.query.kw,
  order: 0,
  type: 0,
  offset: 0 * 20,
  limit: 1 * 20,
});

updataSearch(obj1);
</script>

<style lang="scss" scoped>
.cookbookIntegrate {
  padding: 15px 20px 0;
}
</style>
